package net.jlnx.Uebung5_3.data;

import java.util.Vector;

public class GenStack<T> {
	Vector<T> vector = new Vector<T>();

	public boolean empty() {
		boolean empty = true;
		if (this.vector.size() > 0) {
			empty = false;
		}
		return empty;
	}

	public T peek() {
		return this.vector.lastElement();
	}

	public T pop() {
		T tmp = this.peek();
		this.vector.removeElementAt(this.vector.size() - 1);
		return tmp;
	}

	public T push(T object) {
		this.vector.add(object);
		return this.peek();
	}

}